﻿@using CoreData
@model IEnumerable<EmailList>
@if (Model != null && Model.Count() > 0)
{
    int i = 0;
    <table cellpadding="0" cellspacing="0" width="100%" class="table" id="tSortable">
        <thead>
            <tr>
                <th width="20px">
                    
                </th>
                <th>
                    Code
                </th>
                <th>
                    Email
                </th>
            </tr>
        </thead>
        <tbody>
            @foreach (var item in Model)
            {
                i++;
                <tr>
                    <td>
                        @i
                    </td>
                    <td>
                        @item.Email
                    </td>
                    <td>
                        @if (Helper.SessionManagement.Value("pvalue").Contains("U"))
                        {
                            <a title="Update" href="@Url.Action("AddOrUpdate", "EmailListManagement", new { id = item.ID })" class="icon-pencil">
                            </a>
                        }
                        @if (Helper.SessionManagement.Value("pvalue").Contains("D"))
                        {
                            <a title="Delete" href="@Url.Action("Delete", "EmailListManagement", new { id = item.ID })" class="icon-trash" onclick="return confirm('Do you want delete ?');">
                            </a>
                        }
                    </td>
                </tr>
            }
        </tbody>
    </table>
}
else
{
    <h2 class="error-text">
        Not any email here.
    </h2>
}